<template>
	<div class="version-list">
		<div v-for="(item, index) in versions" :key="index" class="version-item">
			<div class="version-title">{{ item.affiche_title }}</div>
			<div class="version-content">{{ item.affiche_content }}</div>
			<div class="version-time">{{ item.create_time }}</div>
		</div>
	</div>
</template>

<script>
	import {
		publicAfficheList
	} from '@/api/api.js'
	export default {
		data() {
			return {
				versions: [],
			}
		},
		onLoad() {
			this.loadList()
		},
		methods: {
			
			loadList() {
				publicAfficheList().then(res => {
					console.log(res.data)
					if (res.data.code != 0) {
						uni.showToast({
							icon: "none",
							title: res.data.message
						})
					} else {
						this.versions = res.data.data.list
					}
				})
			},
			timeLoad(time) {
				const d = new Date(time * 1000)
				return formatDate(d, 'yyyy-MM-dd')
			},
		}
	}
</script>

<style>
	.version-list {
		display: flex;
		flex-direction: column;
		gap: 10px;
	}

	.version-item {
		border: 1px solid #ccc;
		padding: 10px;
	}

	.version-title {
		font-size: 20px;
		font-weight: bold;
	}

	.version-content {
		font-size: 16px;
	}

	.version-time {
		font-size: 14px;
		color: #999;
	}
</style>